package com.ywk.base.javaBase.ioStream;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

public class BufferReaderAndWriterTest {

	public static void main(String[] args) {
		try {
			BufferedWriter bw = new BufferedWriter(new FileWriter("E:\\代码编程。。。。\\Java\\my app\\ew\\mydir1\\mydir2\\bw.test"));
			BufferedReader br = new BufferedReader(new FileReader("E:\\代码编程。。。。\\Java\\my app\\ew\\mydir1\\mydir2\\bw.test"));
			String s;
			for (int i = 0; i <= 33; i++) {
				s = String.valueOf(Math.random());
				bw.write(s);
				bw.newLine();//换行
			}
			bw.flush();//将bw里面的数倒掉
			while((s = br.readLine()) != null){
				System.out.println(s);
			}
			bw.close();
			br.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		
	}

}
